//
//  WordProgressCell.m
//  Learn
//
//  Created by chijianguo on 2024/4/10.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "WordProgressCell.h"

@implementation WordProgressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.controlView.layer.cornerRadius = 11;
    self.controlView.layer.masksToBounds = YES;
    self.autoBtn.layer.cornerRadius = 10;
    self.autoBtn.layer.masksToBounds = YES;
    self.handBtn.layer.cornerRadius = 10;
    self.handBtn.layer.masksToBounds = YES;
    self.handBtn.backgroundColor = rgba(12, 183, 108, 1);
    [self.handBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    self.autoBtn.backgroundColor = UIColor.whiteColor;
    [self.autoBtn setTitleColor:rgba(12, 183, 108, 1) forState:UIControlStateNormal];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
}
- (IBAction)clickedAutoBtn:(UIButton *)sender {
    self.handBtn.backgroundColor = rgba(12, 183, 108, 1);
    [self.handBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    self.autoBtn.backgroundColor = UIColor.whiteColor;
    [self.autoBtn setTitleColor:rgba(12, 183, 108, 1) forState:UIControlStateNormal];
    if(self.changeBlock){
        self.changeBlock(0);
    }
}
- (IBAction)clickedHandBtn:(UIButton *)sender {
    self.handBtn.backgroundColor = UIColor.whiteColor;
    [self.handBtn setTitleColor:rgba(12, 183, 108, 1) forState:UIControlStateNormal];
    self.autoBtn.backgroundColor = rgba(12, 183, 108, 1);
    [self.autoBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
    if(self.changeBlock){
        self.changeBlock(1);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
